package com.vdong.trade.trading.common.enums;

/**
 * @author <a href="mailto:clf@vdongzc.com">clf</a>
 * @Description: AmountTypeEnum 资金交易类型枚举
 * @Date Create on 2018-12-13 15:10:22
 * @since version1.0
 */
public enum AmountTypeEnum {

    /**
     * 资金交易类型枚举
     */
    WITHDRAWAL_FREEZE((short) 1, "提现冻结"),
    WITHDRAWAL_UNFREEZE((short) 2, "提现解冻"),
    WITHDRAWAL_SUCCESS((short) 3, "提现成功"),

    SETTLE_ACCOUNT((short) 4, "结算"),
    PLACE_AN_ORDER((short) 5, "下单"),;

    /**
     * 资金交易类型
     */
    private final Short type;

    /**
     * 备注
     */
    private final String desc;

    AmountTypeEnum(Short type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Short getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static AmountTypeEnum getEnumByType(Short type) {
        if (null != type) {
            for (AmountTypeEnum amountTypeEnum : values()) {
                if (amountTypeEnum.getType().equals(type)) {
                    return amountTypeEnum;
                }
            }
        }
        return null;
    }
}
